<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>获取文件的大小和类型</title>
<script type="text/javascript">
function ShowType(){
	var files=document.getElementById("files").files;   /* 获取FileList对象 */
	var msg=document.getElementById("msg");
	var file;
	for(var i=0;i<files.length;i++){
		file=fileList[i];             /* 获取单个File对象 */
		msg.innerHTML+="字节长度："+file.size+";<br />";
		msg.innerHTML+="文件类型："+file.type+";<br />";
	}
}
</script>
</head>
<body>
<form action="" method="post">
  <input type="file" id="files" multiple accept="image/*" />
  <input type="button" value="显示文件数据" onclick="ShowType()" />
  <p id="msg"></p>
</form>
</body>
</html>